home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / webbrwsr / nsIPrintingPromptService.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  15KB  |  274 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIPrintingPromptService.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIPrintingPromptService_h__
  6. #define __gen_nsIPrintingPromptService_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. #ifndef __gen_nsIWebBrowserPrint_h__
  14. #include "nsIWebBrowserPrint.h"
  15. #endif
  16.  
  17. #ifndef __gen_nsIWebProgressListener_h__
  18. #include "nsIWebProgressListener.h"
  19. #endif
  20.  
  21. #ifndef __gen_nsIPrintProgressParams_h__
  22. #include "nsIPrintProgressParams.h"
  23. #endif
  24.  
  25. #ifndef __gen_nsIPrintSettings_h__
  26. #include "nsIPrintSettings.h"
  27. #endif
  28.  
  29. #ifndef __gen_nsIObserver_h__
  30. #include "nsIObserver.h"
  31. #endif
  32.  
  33. /* For IDL files that don't want to include root IDL files. */
  34. #ifndef NS_NO_VTABLE
  35. #define NS_NO_VTABLE
  36. #endif
  37. class nsIDOMWindow; /* forward declaration */
  38.  
  39.  
  40. /* starting interface:    nsIPrintingPromptService */
  41. #define NS_IPRINTINGPROMPTSERVICE_IID_STR "75d1553d-63bf-4b5d-a8f7-e4e4cac21ba4"
  42.  
  43. #define NS_IPRINTINGPROMPTSERVICE_IID \
  44.   {0x75d1553d, 0x63bf, 0x4b5d, \
  45.     { 0xa8, 0xf7, 0xe4, 0xe4, 0xca, 0xc2, 0x1b, 0xa4 }}
  46.  
  47. class NS_NO_VTABLE nsIPrintingPromptService : public nsISupports {
  48.  public: 
  49.  
  50.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPRINTINGPROMPTSERVICE_IID)
  51.  
  52.   /**
  53.    *  This service enables embedders to implement their own Print and Progress Dialogs.
  54.    *  Each platform has a "base" or "basckstop" implementation of the service. The 
  55.    *  service is automatically registered at start up.
  56.    *
  57.    *  Historically, platform toolkits with native dialogs have implemented them in the GFX layer
  58.    *  Usually they were displayed when a new DeviceContextSpec specific to that platform
  59.    *  was created.
  60.    *
  61.    *  Windows: The GFX layer no longers supports default toolkit behavior for displaying the 
  62.    *           native Print Dialog.
  63.    *           If an embedder implemented service returns any error code (other than NS_ERROR_ABORT)
  64.    *           printing will terminate.
  65.    *
  66.    *           Returning NS_OK assumes that the PrintSettings object was correctly filled in and
  67.    *           if it does not have valid fields for printer name, etc. it may also terminate.
  68.    *
  69.    *           Defaults for platform service:           
  70.    *             showPrintDialog       - displays a native dialog
  71.    *             showPageSetup         - displays a XUL dialog
  72.    *             showProgress          - displays a XUL dialog
  73.    *             showPrinterProperties - n/a
  74.    *
  75.    *           Summary for Windows Embedders:
  76.    *             Stated once again: There is no "fallback" native platform support in GFX for the
  77.    *             displaying of the native print dialog. The current default implementation for Windows
  78.    *             display a native print dialog but a XUL-based progress dialog.
  79.    *             If you wish to have a native progress dialog on Windows you will have to create and 
  80.    *             register your own service.
  81.    *  
  82.    *             Note: The Windows version Mozilla implements this service which is 
  83.    *                   automatically built and registered for you. You can use it as an example.
  84.    *                   It is located at "mozilla/embedding/components/printingui/src/win". That service
  85.    *                   is capable of displaying a native print dialog and a XUL progress dialog.
  86.    *
  87.    *             To fly your own dialog you may:
  88.    *
  89.    *              1) Implement this service to display at least the Print Dialog and a Print Progress Dialog
  90.    *                 or you may implement just one of the dialogs and pass back NS_ERROR_NOT_IMPLEMENTED
  91.    *                 for any of the others.
  92.    *
  93.    *              2) For the Print Dialog:
  94.    *                 You may stub out this service by having all the methods return NS_ERROR_NOT_IMPLEMENTED.
  95.    *                 You can then fly you own dialog and then properly fill in the PrintSettings object
  96.    *                 before calling nsIWebBrowserPrint's Print method. If you stub out this service  
  97.    *                 you MUST set "printSilent" to true, if you do not, Printing will terminate and an 
  98.    *                 error dialog will be displayed.
  99.    *
  100.    *  Mac: The GFX layer still supports default toolkit behavior for displaying the Print Dialog.
  101.    *       If an embedder implemented service returns NS_ERROR_NOT_IMPLEMENTED for "showPrintDialog"
  102.    *       The toolkit will display the native print dialog.
  103.    *
  104.    *       Defaults for platform service:           
  105.    *       Mac OS9: showPrintDialog       - displays a native dialog
  106.    *                showPageSetup         - displays a native dialog
  107.    *                showProgress          - displays a XUL dialog
  108.    *                showPrinterProperties - n/a
  109.    *                
  110.    *       Mac OSX: showPrintDialog       - displays a native dialog
  111.    *                showPageSetup         - displays a native dialog
  112.    *                showProgress          - not implemented (provided by OS)
  113.    *                showPrinterProperties - n/a
  114.    *                
  115.    *  GTK: There are no native dialog for GTK.
  116.    *
  117.    *       Defaults for platform service:           
  118.    *         showPrintDialog       - displays a XUL dialog
  119.    *         showPageSetup         - displays a XUL dialog
  120.    *         showProgress          - displays a XUL dialog
  121.    *         showPrinterProperties - displays a XUL dialog
  122.    *              
  123.    *  OS2: 
  124.    *
  125.    *       Defaults for platform service:           
  126.    *         showPrintDialog       - displays a XUL dialog
  127.    *         showPageSetup         - displays a XUL dialog
  128.    *         showProgress          - displays a XUL dialog
  129.    *         showPrinterProperties - displays a native dialog
  130.    *              
  131.    *
  132.    */
  133. /**
  134.    *  Show the Print Dialog 
  135.    *
  136.    *  @param parent - a DOM windows the dialog will be parented to (required)
  137.    *  @param webBrowserPrint - represents the document to be printed (required)
  138.    *  @param printSettings - PrintSettings for print "job" (required)
  139.    *
  140.    */
  141.   /* void showPrintDialog (in nsIDOMWindow parent, in nsIWebBrowserPrint webBrowserPrint, in nsIPrintSettings printSettings); */
  142.   NS_IMETHOD ShowPrintDialog(nsIDOMWindow *parent, nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings) = 0;
  143.  
  144.   /**
  145.    *  Shows the print progress dialog
  146.    *
  147.    *  @param parent - a DOM windows the dialog will be parented to
  148.    *  @param webBrowserPrint - represents the document to be printed
  149.    *  @param printSettings - PrintSettings for print "job"
  150.    *  @param openDialogObserver - an observer that will be notifed when the dialog is opened
  151.    *  @param isForPrinting - true - for printing, false for print preview
  152.    *  @param webProgressListener - additional listener can be registered for progress notifications
  153.    *  @param printProgressParams - parameter object for passing progress state
  154.    *  @param notifyOnOpen - this indicates that the observer will be notified when the progress
  155.    *                        dialog has been opened. If false is returned it means the observer
  156.    *                        (usually the caller) shouldn't wait
  157.    *                        For Print Preview Progress there is intermediate progress
  158.    */
  159.   /* void showProgress (in nsIDOMWindow parent, in nsIWebBrowserPrint webBrowserPrint, in nsIPrintSettings printSettings, in nsIObserver openDialogObserver, in boolean isForPrinting, out nsIWebProgressListener webProgressListener, out nsIPrintProgressParams printProgressParams, out boolean notifyOnOpen); */
  160.   NS_IMETHOD ShowProgress(nsIDOMWindow *parent, nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings, nsIObserver *openDialogObserver, PRBool isForPrinting, nsIWebProgressListener **webProgressListener, nsIPrintProgressParams **printProgressParams, PRBool *notifyOnOpen) = 0;
  161.  
  162.   /**
  163.    *  Shows the print progress dialog
  164.    *
  165.    *  @param parent - a DOM windows the dialog will be parented to (required)
  166.    *  @param printSettings - PrintSettings for page setup (required)
  167.    *  @param aObs - An observer to know if the contents of the Print Settings 
  168.    *                object has changed while the dialog is being shown. 
  169.    *                For example, some platforms may implement an "Apply" button (not required)
  170.    */
  171.   /* void showPageSetup (in nsIDOMWindow parent, in nsIPrintSettings printSettings, in nsIObserver aObs); */
  172.   NS_IMETHOD ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *printSettings, nsIObserver *aObs) = 0;
  173.  
  174.   /**
  175.    *  Sometimes platforms need to bring up a special properties dialog for showing
  176.    *  print specific properties. Although the PrintSettings has a place to set the 
  177.    *  printer name, here is is an argument to be clear as to what printer is being
  178.    *  asked to have the properties set for it. The Printer name in the PS is ignored.
  179.    *
  180.    *  @param parent - a DOM windows the dialog will be parented to (required)
  181.    *  @param printerName - name of printer (required)
  182.    *  @param printSettings - PrintSettings for page setup (required)
  183.    */
  184.   /* void showPrinterProperties (in nsIDOMWindow parent, in wstring printerName, in nsIPrintSettings printSettings); */
  185.   NS_IMETHOD ShowPrinterProperties(nsIDOMWindow *parent, const PRUnichar *printerName, nsIPrintSettings *printSettings) = 0;
  186.  
  187. };
  188.  
  189. /* Use this macro when declaring classes that implement this interface. */
  190. #define NS_DECL_NSIPRINTINGPROMPTSERVICE \
  191.   NS_IMETHOD ShowPrintDialog(nsIDOMWindow *parent, nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings); \
  192.   NS_IMETHOD ShowProgress(nsIDOMWindow *parent, nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings, nsIObserver *openDialogObserver, PRBool isForPrinting, nsIWebProgressListener **webProgressListener, nsIPrintProgressParams **printProgressParams, PRBool *notifyOnOpen); \
  193.   NS_IMETHOD ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *printSettings, nsIObserver *aObs); \
  194.   NS_IMETHOD ShowPrinterProperties(nsIDOMWindow *parent, const PRUnichar *printerName, nsIPrintSettings *printSettings); 
  195.  
  196. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  197. #define NS_FORWARD_NSIPRINTINGPROMPTSERVICE(_to) \
  198.   NS_IMETHOD ShowPrintDialog(nsIDOMWindow *parent, nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings) { return _to ShowPrintDialog(parent, webBrowserPrint, printSettings); } \
  199.   NS_IMETHOD ShowProgress(nsIDOMWindow *parent, nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings, nsIObserver *openDialogObserver, PRBool isForPrinting, nsIWebProgressListener **webProgressListener, nsIPrintProgressParams **printProgressParams, PRBool *notifyOnOpen) { return _to ShowProgress(parent, webBrowserPrint, printSettings, openDialogObserver, isForPrinting, webProgressListener, printProgressParams, notifyOnOpen); } \
  200.   NS_IMETHOD ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *printSettings, nsIObserver *aObs) { return _to ShowPageSetup(parent, printSettings, aObs); } \
  201.   NS_IMETHOD ShowPrinterProperties(nsIDOMWindow *parent, const PRUnichar *printerName, nsIPrintSettings *printSettings) { return _to ShowPrinterProperties(parent, printerName, printSettings); } 
  202.  
  203. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  204. #define NS_FORWARD_SAFE_NSIPRINTINGPROMPTSERVICE(_to) \
  205.   NS_IMETHOD ShowPrintDialog(nsIDOMWindow *parent, nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings) { return !_to ? NS_ERROR_NULL_POINTER : _to->ShowPrintDialog(parent, webBrowserPrint, printSettings); } \
  206.   NS_IMETHOD ShowProgress(nsIDOMWindow *parent, nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings, nsIObserver *openDialogObserver, PRBool isForPrinting, nsIWebProgressListener **webProgressListener, nsIPrintProgressParams **printProgressParams, PRBool *notifyOnOpen) { return !_to ? NS_ERROR_NULL_POINTER : _to->ShowProgress(parent, webBrowserPrint, printSettings, openDialogObserver, isForPrinting, webProgressListener, printProgressParams, notifyOnOpen); } \
  207.   NS_IMETHOD ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *printSettings, nsIObserver *aObs) { return !_to ? NS_ERROR_NULL_POINTER : _to->ShowPageSetup(parent, printSettings, aObs); } \
  208.   NS_IMETHOD ShowPrinterProperties(nsIDOMWindow *parent, const PRUnichar *printerName, nsIPrintSettings *printSettings) { return !_to ? NS_ERROR_NULL_POINTER : _to->ShowPrinterProperties(parent, printerName, printSettings); } 
  209.  
  210. #if 0
  211. /* Use the code below as a template for the implementation class for this interface. */
  212.  
  213. /* Header file */
  214. class nsPrintingPromptService : public nsIPrintingPromptService
  215. {
  216. public:
  217.   NS_DECL_ISUPPORTS
  218.   NS_DECL_NSIPRINTINGPROMPTSERVICE
  219.  
  220.   nsPrintingPromptService();
  221.  
  222. private:
  223.   ~nsPrintingPromptService();
  224.  
  225. protected:
  226.   /* additional members */
  227. };
  228.  
  229. /* Implementation file */
  230. NS_IMPL_ISUPPORTS1(nsPrintingPromptService, nsIPrintingPromptService)
  231.  
  232. nsPrintingPromptService::nsPrintingPromptService()
  233. {
  234.   /* member initializers and constructor code */
  235. }
  236.  
  237. nsPrintingPromptService::~nsPrintingPromptService()
  238. {
  239.   /* destructor code */
  240. }
  241.  
  242. /* void showPrintDialog (in nsIDOMWindow parent, in nsIWebBrowserPrint webBrowserPrint, in nsIPrintSettings printSettings); */
  243. NS_IMETHODIMP nsPrintingPromptService::ShowPrintDialog(nsIDOMWindow *parent, nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings)
  244. {
  245.     return NS_ERROR_NOT_IMPLEMENTED;
  246. }
  247.  
  248. /* void showProgress (in nsIDOMWindow parent, in nsIWebBrowserPrint webBrowserPrint, in nsIPrintSettings printSettings, in nsIObserver openDialogObserver, in boolean isForPrinting, out nsIWebProgressListener webProgressListener, out nsIPrintProgressParams printProgressParams, out boolean notifyOnOpen); */
  249. NS_IMETHODIMP nsPrintingPromptService::ShowProgress(nsIDOMWindow *parent, nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings, nsIObserver *openDialogObserver, PRBool isForPrinting, nsIWebProgressListener **webProgressListener, nsIPrintProgressParams **printProgressParams, PRBool *notifyOnOpen)
  250. {
  251.     return NS_ERROR_NOT_IMPLEMENTED;
  252. }
  253.  
  254. /* void showPageSetup (in nsIDOMWindow parent, in nsIPrintSettings printSettings, in nsIObserver aObs); */
  255. NS_IMETHODIMP nsPrintingPromptService::ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *printSettings, nsIObserver *aObs)
  256. {
  257.     return NS_ERROR_NOT_IMPLEMENTED;
  258. }
  259.  
  260. /* void showPrinterProperties (in nsIDOMWindow parent, in wstring printerName, in nsIPrintSettings printSettings); */
  261. NS_IMETHODIMP nsPrintingPromptService::ShowPrinterProperties(nsIDOMWindow *parent, const PRUnichar *printerName, nsIPrintSettings *printSettings)
  262. {
  263.     return NS_ERROR_NOT_IMPLEMENTED;
  264. }
  265.  
  266. /* End of implementation class template. */
  267. #endif
  268.  
  269. // {260FEDC5-524D-4aa6-9A41-E829F4C78B92}
  270. #define NS_PRINTINGPROMPTSERVICE_IID \
  271.  {0x260fedc5, 0x524d, 0x4aa6, { 0x9a, 0x41, 0xe8, 0x29, 0xf4, 0xc7, 0x8b, 0x92}}
  272.  
  273. #endif /* __gen_nsIPrintingPromptService_h__ */
  274.